package com.huanzhidadi.hystrix.feign.consumer.feign;

import com.huanzhidadi.hystrix.feign.consumer.service.HystrixProviderFallbackService;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
@FeignClient(value = "hystrix-provider", fallback = HystrixProviderFallbackService.class)
public interface HystrixProviderService {

    @GetMapping("/payment/ok/{id}")
    public String paymentInfo_OK(@PathVariable("id") Integer id);

    @GetMapping("/payment/timeout/{id}")
    public String paymentInfo_FAIL(@PathVariable("id") Integer id);
}
